package com.sumi.erp.service.impl;

import java.util.List;
import com.sumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sumi.erp.mapper.FinanceSaleReceiptMapper;
import com.sumi.erp.domain.FinanceSaleReceipt;
import com.sumi.erp.service.IFinanceSaleReceiptService;

/**
 * 收款单Service业务层处理
 * 
 * @author fgf67@163.com
 * @date 2024-06-28
 */
@Service
public class FinanceSaleReceiptServiceImpl implements IFinanceSaleReceiptService 
{
    @Autowired
    private FinanceSaleReceiptMapper financeSaleReceiptMapper;

    /**
     * 查询收款单
     * 
     * @param id 收款单主键
     * @return 收款单
     */
    @Override
    public FinanceSaleReceipt selectFinanceSaleReceiptById(Long id)
    {
        return financeSaleReceiptMapper.selectFinanceSaleReceiptById(id);
    }

    /**
     * 查询收款单列表
     * 
     * @param financeSaleReceipt 收款单
     * @return 收款单
     */
    @Override
    public List<FinanceSaleReceipt> selectFinanceSaleReceiptList(FinanceSaleReceipt financeSaleReceipt)
    {
        return financeSaleReceiptMapper.selectFinanceSaleReceiptList(financeSaleReceipt);
    }

    /**
     * 新增收款单
     * 
     * @param financeSaleReceipt 收款单
     * @return 结果
     */
    @Override
    public int insertFinanceSaleReceipt(FinanceSaleReceipt financeSaleReceipt)
    {
        financeSaleReceipt.setCreateTime(DateUtils.getNowDate());
        return financeSaleReceiptMapper.insertFinanceSaleReceipt(financeSaleReceipt);
    }

    /**
     * 修改收款单
     * 
     * @param financeSaleReceipt 收款单
     * @return 结果
     */
    @Override
    public int updateFinanceSaleReceipt(FinanceSaleReceipt financeSaleReceipt)
    {
        return financeSaleReceiptMapper.updateFinanceSaleReceipt(financeSaleReceipt);
    }

    /**
     * 批量删除收款单
     * 
     * @param ids 需要删除的收款单主键
     * @return 结果
     */
    @Override
    public int deleteFinanceSaleReceiptByIds(Long[] ids)
    {
        return financeSaleReceiptMapper.deleteFinanceSaleReceiptByIds(ids);
    }

    /**
     * 删除收款单信息
     * 
     * @param id 收款单主键
     * @return 结果
     */
    @Override
    public int deleteFinanceSaleReceiptById(Long id)
    {
        return financeSaleReceiptMapper.deleteFinanceSaleReceiptById(id);
    }
}
